package jmine.tec.hydra.export;

import java.util.ArrayList;
import java.util.List;

import jmine.tec.hydra.domain.specification.HydraSpecificationImpl;
import jmine.tec.hydra.services.incluir.HydraSpecificationService;
import jmine.tec.services.api.export.AbstractServiceFillerEntityExporter;
import jmine.tec.services.api.export.DefaultExportAction;

/**
 * Exportador de HydraSpecificationImpl
 * 
 * @author lundberg
 */
public class HydraSpecificationExporter extends AbstractServiceFillerEntityExporter<HydraSpecificationImpl> {

    /**
     * Construtor
     */
    public HydraSpecificationExporter() {
        super(new HydraSpecificationService<HydraSpecificationImpl>(), DefaultExportAction.INCLUIR);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public List<Object> exportBefore(HydraSpecificationImpl entity) {
        List<Object> before = new ArrayList<Object>(super.exportBefore(entity));
        if (entity.getSenderRegistry() != null) {
            before.add(entity.getSenderRegistry());
        }
        return before;
    }
}
